package com.pri.chat.activity;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.netease.nim.uikit.net.SharedHelper;
import com.pri.chat.MainActivity;
import com.pri.chat.R;
import com.pri.chat.application.APP;

import java.util.Timer;
import java.util.TimerTask;

import androidx.appcompat.app.AppCompatActivity;


public class PicBigActivity extends AppCompatActivity {
    private SharedHelper sharedHelper;
    private Context mContext;
    private ImageView back,iv_splash;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.pic_big_activity);
        APP.getInstance().add(this);

        mContext = this;
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        //透明导航栏
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        SharedPreferences sp = getSharedPreferences("login", Context.MODE_PRIVATE);

        String path = getIntent().getStringExtra("path");
        back = findViewById(R.id.iv_back);
        iv_splash = findViewById(R.id.iv_splash);

        RequestOptions options = new RequestOptions()
                .placeholder(R.mipmap.img_default)//图片加载出来前，显示的图片
                .fallback( R.mipmap.img_default) //url为空的时候,显示的图片
                .error(R.mipmap.img_default);//图片加载失败后，显示的图片
        Glide.with(this).load(path).apply(options).into(iv_splash);

        iv_splash.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });

    }
}
